window.addEventListener("load",function(){_(),g(),h(),k(),L(),m()});(function(){window.onpageshow=function(o){o.persisted&&window.location.reload()}})();function _(){var o=document.querySelectorAll(".collapse");o&&o.forEach(function(e){var t=e.querySelector(".collapse__header"),n=e.querySelector(".collapse__body");t&&n&&t.addEventListener("click",function(){var c=e.closest(".collapse_group");if(c){var a=c.querySelector(".collapse--active");if(a!==e&&a){a.classList.remove("collapse--active");var l=a.querySelector(".collapse__body");l&&(l.style.height="0px")}e.classList.toggle("collapse--active"),e.classList.contains("collapse--active")?n.style.height=n.scrollHeight+"px":n.style.height="0px"}})})}function g(){var o=document.querySelector(".header__burger");if(o){let i=function(){e.classList.remove("header--open"),document.body.style.overflow="auto"};var l=i,e=document.querySelector(".header");o.addEventListener("click",function(){e.classList.toggle("header--open"),document.body.style.overflow="hidden"});var t=document.querySelector(".header__overlay");t&&t.addEventListener("click",i);var n=document.querySelector(".navbar__close");n&&n.addEventListener("click",i);var c=document.querySelector(".header .language");c&&(c.addEventListener("click",function(){c.classList.toggle("language--open")}),document.addEventListener("click",function(r){c.contains(r.target)||c.classList.remove("language--open")}));var a=null;window.addEventListener("resize",function(){clearTimeout(a),a=setTimeout(function(){e.classList.contains("header--open")&&(e.classList.remove("header--open"),document.body.style.overflow="auto"),c.classList.contains("language--open")&&c.classList.remove("language--open")},100)})}}function h(){var o=document.querySelector(".cookie-banner");if(!o||y("cookies_accepted")!="")return;o.classList.add("cookie-banner--show");var e=document.querySelector(".cookie-popup"),t=o.querySelector(".cookie-banner--accept"),n=o.querySelector(".cookie-banner--reject"),c=o.querySelector(".cookie-banner--customize");function a(){o.classList.remove("cookie-banner--show"),o.style.bottom=-o.offsetHeight+"px"}if(t&&t.addEventListener("click",function(){p("cookies_accepted","true",{expires:new Date("31 Dec 9999 23:59:59 GMT"),secure:!0,path:"/"}),typeof gtag<"u"&>ag("consent","update",{ad_storage:"granted",analytics_storage:"granted",ad_user_data:"granted",ad_personalization:"granted",functionality_storage:"granted",personalization_storage:"granted",security_storage:"granted"}),a()}),n&&n.addEventListener("click",function(){p("cookies_accepted","false",{expires:new Date("31 Dec 9999 23:59:59 GMT"),secure:!0,path:"/"}),typeof gtag<"u"&>ag("consent","update",{ad_storage:"denied",analytics_storage:"denied",ad_user_data:"denied",ad_personalization:"denied",functionality_storage:"denied",personalization_storage:"denied",security_storage:"denied"}),a()}),c&&c.addEventListener("click",function(){var s=document.querySelector(".cookie-popup");s&&s.classList.add("cookie-popup--show")}),e){e.addEventListener("click",function(s){s.target.classList.contains("cookie-popup")&&e.classList.remove("cookie-popup--show")});var l=e.querySelector(".cookie-popup__close");l&&l.addEventListener("click",function(){e.classList.remove("cookie-popup--show")});var i=e.querySelectorAll(".item");i&&i.forEach(function(s){s.addEventListener("click",function(){s.classList.toggle("item--active");var f=s.querySelector(".item__body");f&&(s.classList.contains("item--active")?f.style.height=f.scrollHeight+"px":f.style.height="0px")})});var r=e.querySelector(".cookie-popup .button--necessary"),u=e.querySelector(".cookie-popup .button--selected"),d=e.querySelector(".cookie-popup .button--all"),v=e.querySelectorAll(".cookie-popup .item__chackbox");r&&r.addEventListener("click",function(){p("cookie_level","necessary",{expires:new Date("31 Dec 9999 23:59:59 GMT"),secure:!0,path:"/"}),e.classList.remove("cookie-popup--show"),a()}),u&&u.addEventListener("click",function(){p("cookie_level","selected",{expires:new Date("31 Dec 9999 23:59:59 GMT"),secure:!0,path:"/"}),e.classList.remove("cookie-popup--show"),a()}),d&&d.addEventListener("click",function(){p("cookie_level","all",{expires:new Date("31 Dec 9999 23:59:59 GMT"),secure:!0,path:"/"}),e.classList.remove("cookie-popup--show"),a()}),v&&v.forEach(function(s){s.addEventListener("click",function(f){f.stopPropagation()})})}}function p(o,e,t={}){t={path:"/",...t},t.expires instanceof Date&&(t.expires=t.expires.toUTCString());let n=encodeURIComponent(o)+"="+encodeURIComponent(e);for(let c in t){n+="; "+c;let a=t[c];a!==!0&&(n+="="+a)}document.cookie=n}function y(o){var e;return((e=document.cookie.split("; ").find(t=>t.startsWith(o+"=")))==null?void 0:e.split("=")[1])||""}function k(){document.querySelectorAll(".blog_item").forEach(function(e){let t=e.querySelector(".blog__link");t&&(t=t.getAttribute("href"),t&&e.addEventListener("click",function(){window.location=t}))})}function L(){var o=document.querySelectorAll(".dropdown");o.forEach(function(e){let t=e.querySelector(".popup__search-input"),n=e.querySelector(".dropdown__value"),c=e.querySelectorAll(".list__item");e.addEventListener("click",function(i){i.target.closest(".popup")||(e.classList.toggle("dropdown--open"),t&&e.classList.contains("dropdown--open")&&t.focus())}),c.forEach(function(i){i.addEventListener("click",function(){let r=i.dataset;n.value=r.id||null;for(let u in r)n.setAttribute("data-"+u,r[u]);if(e.classList.remove("dropdown--open"),n.dispatchEvent(new Event("change")),e.querySelector(".dropdown__selection").innerText=i.innerText,e.classList.contains("dropdown--country")){let u=e.getAttribute("data-flag-path"),d=e.querySelector(".dropdown__country_flag");d.classList.remove("hidden"),d&&r.flag&&(d.src=u+"/"+r.flag+".svg")}a(i)})}),t&&(t.addEventListener("input",function(){let i=t.value.toLowerCase();c.forEach(function(r){let u=r.getAttribute("data-name").toLowerCase(),d=r.getAttribute("data-title").toLowerCase();u.includes(i)||d.includes(i)?r.classList.remove("list__item--hidden"):r.classList.add("list__item--hidden")})}),t.addEventListener("keydown",function(i){if(i.key==="Escape")e.classList.remove("dropdown--open"),t.value="",l();else if(i.key==="Enter"){i.preventDefault(),i.stopPropagation();let r=e.querySelector(".list__item:not(.list__item--hidden)");r&&(r.click(),a(r)),t.value="",e.classList.remove("dropdown--open"),l()}}));function a(i){c.forEach(function(r){r.classList.remove("list__item--active")}),i.classList.add("list__item--active")}function l(){c.forEach(function(i){i.classList.remove("list__item--hidden")})}}),document.addEventListener("click",function(e){e.target.closest(".dropdown")||o.forEach(function(t){t.classList.remove("dropdown--open")})})}function m(){document.querySelectorAll(".home .card.category").forEach(function(e){e.addEventListener("click",function(){let t=e.querySelector(".category__choose");if(!t)return;let n=t.getAttribute("href");n&&(window.location=n)})})}